package models;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;


@Entity
public class Turma implements Serializable{
	private static final long serialVersionUID = -568440839219869887L;
	
	private int id;
	private String codigo;
	private int horario;
	private int diaInicio;
	private Aluno aluno; 
	private Idioma idioma; 
	
	
	public Turma() {
		super();
	
	}


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}


	public void setId(int id) {
		this.id = id;
	}


	public String getCodigo() {
		return codigo;
	}


	public void setCodigo(String codigo) {
		this.codigo = codigo;
	}


	public int getHorario() {
		return horario;
	}


	public void setHorario(int horario) {
		this.horario = horario;
	}


	public int getDiaInicio() {
		return diaInicio;
	}


	public void setDiaInicio(int diaInicio) {
		this.diaInicio = diaInicio;
	}


	
	@OneToMany(mappedBy="turma")
	@OrderBy("data DESC")
	public Aluno getAluno() {
		return aluno;
	}


	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
	}


	@ManyToOne (optional=false)
	public Idioma getIdioma() {
		return idioma;
	}


	public void setIdioma(Idioma idioma) {
		this.idioma = idioma;
	}
	
	
	
	
	
	
	
	
	
	
	
}
